
const Game = require('../../data/Game');
const HttpHelper = require('../../comm/HttpHelper');
let AudioMgr = require('../../comm/AudioMgr');
let User = require('../../data/User');
let Role = require('../../data/Role');
cc.Class({
    extends: cc.Component,

    properties: {
       
    },
    onLoad () {
        let http = HttpHelper.getInstance();
        let audioMgr = AudioMgr.getInstance();
        let user = new User();
        user.role = new Role();
        window.game = Game.getInstance({
            http:http,
            audioMgr:audioMgr,
            user:user
        });
    },

    start () {
        if(game){
            game.audioMgr.playMusic('bgHulu',true);
        };
        this.node.on(cc.Node.EventType.TOUCH_START,()=>{
            game.audioMgr.playEffect('btnClick',false);
        },this) 
        /*game.http.request({
            url:'http://127.0.0.1:7001/login',
            method: 'GET',
            data:{account:123,xi:576}
        },(err,data)=>{
            console.log(data);
        });*/
    },
    

});
